package com.web.expspringboot.controller;

import com.web.expspringboot.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.nio.file.Path;
import java.nio.file.Paths;

@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    FileService fs;

    @PostMapping("/defaultUpLoadFile")    //上传文件并返回网址
    public String upLoadFile(@RequestParam("file") MultipartFile file){
        return fs.defaultUploadFile(file);
    }

}
